package com.hospital.common.core.constants;

/**
 * @author lvyao
 * @description 所有固定值
 * @date 2022/2/28
 */
public class AllFinalValueUtils {
    //门诊标识
    public static final String OUTP_FLAG = "01";
    //住院标识
    public static final String INP_FLAG = "02";

    //门诊标识_HL7
    public static final String OUTP_FLAG_HL7 = "O";
    //住院标识_HL7
    public static final String INP_FLAG_HL7 = "I";

    //门诊来源
    public static final String OUTP_CAUSE = "门诊";
    //住院来源
    public static final String INP_CAUSE = "住院";
    //检查门诊患者标识
    public static final String PAT_SOURCE_OUTP = "1";
    //检查住院患者标识
    public static final String PAT_SOURCE_INP = "2";
    //检查其它患者标识
    public static final String PAT_SOURCE_OTHER = "3";
    //HL7检验XML文件字符集替换前
    public static final String UNICODE_DEFAULT_TARGET = "UTF-8";
    //HL7检验XML文件字符集替换后
    public static final String UNICODE_DEFAULT_REPLACEMENT = "UTF8";

    //HL7发送方编码
    public static final String MESSAGE_FROM = "HTSoftWare";
    //HL7检验接收方编码
    public static final String MESSAGE_FROM_LAB = "LisSoftWare";
    //HL7检验事件编码
    public static final String MESSAGE_EVENT_LAB = "OML";
    //HL7检验事件名称
    public static final String MESSAGE_EVENT_NAME_LAB = "O21";

    public static final String MESSAGE_EVENT_NAME_ALL_LAB = "OML_O21";

    //HL7检验需替换字符串
    public static final String MESSAGE_HL7_REPLACE_LAB_BEF_TARGET = "<labHl7Orders>";
    //HL7检验需替换字符串
    public static final String MESSAGE_HL7_REPLACE_LAB_AFT_TARGET = "</labHl7Orders>";

    //HL7检查需替换字符串
    public static final String MESSAGE_HL7_REPLACE_EXAM_BEF_TARGET_A = "<examHl7OrderList>";
    //HL7检查需替换字符串
    public static final String MESSAGE_HL7_REPLACE_EXAM_AFT_TARGET_B = "</examHl7OrderList>";

    //检验结果状态
    public static final String LAB_RESULT_STATUS = "A";
    //检验主表申请状态
    public static final String LAB_MASTER_STATUS = "1";
    //检验主表绿色通道标识
    public static final String LAB_MASTER_GREEN_FLAG = "0";
    //计费标识
    public static final int CHARGE_FLAG = 0;
    //操作员编码
    public static final String ALL_OPERATOR = "0000";
    //HL7检查接收方编码
    public static final String MESSAGE_FROM_EXAM = "LFSoftWare";
    //HL7检查接收事件
    public static final String MESSAGE_EVENT_EXAM = "OMG";
    //HL7检查接收事件名称
    public static final String MESSAGE_EVENT_NAME_EXAM = "O19";

    public static final String MESSAGE_EVENT_NAME_ALL_EXAM = "OMG_O19";

    //HL7检查需替换字符串
    public static final String MESSAGE_HL7_REPLACE_EXAM_BEF_TARGET = "<OBR_31_1>";
    //HL7检查需替换字符串
    public static final String MESSAGE_HL7_REPLACE_EXAM_BEF_REPLACEMENT = "<OBR_31>";
    //HL7检查需替换字符串
    public static final String MESSAGE_HL7_REPLACE_EXAM_AFT_TARGET = "</OBR_31_1>";
    //HL7检查需替换字符串
    public static final String MESSAGE_HL7_REPLACE_EXAM_AFT_REPLACEMENT = "</OBR_31>";
    //HL7检查确认标识
    public static final int EXAM_VERF_INDICATOR = 0;
    //微信创建渠道
    public static final String CREATE_CHANNEL_WX = "1";
    //柜台创建渠道
    public static final String CREATE_CHANNEL_DOOR = "2";
    //自助机创建渠道
    public static final String CREATE_CHANNEL_AUTO_MACHINE = "3";
    //支付宝创建渠道
    public static final String CREATE_CHANNEL_ZHIFUBAO = "4";

    //门诊订单记录表中订单号的列名
    public static final String ORDER_NO_FIELD_NAME = "order_no";
    //计费接口中入参的结算标识字段名称
    public static final String SETTLE_FLAG_FIELD_NAME = "settle_flag";

    //计费接口中入参的结算标识字段结算值
    public static final String SETTLE_FLAG_FIELD_VALUE_TRUE = "1";

    //计费接口中入参的结算标识字段不结算值
    public static final String SETTLE_FLAG_FIELD_VALUE_FALSE = "0";

    //门诊订单记录表中患者标识的列名
    public static final String PATIENT_ID_FIELD_NAME = "patient_id";

    //门诊就诊序列号列名
    public static final String OUTP_VISIT_NO = "visit_no";

    //门诊就诊次数列名
    public static final String OUTP_VISIT_TIME = "outp_id";

    //自费名称
    public static final String OWN_CHARGE_TYPE = "自费";

    //门诊处置对象类名称
    public static final String OUTP_DOC_ASS = "OutpDoctorAssistant";

    //门诊医嘱临时存储表对象类名称
    public static final String OUTP_ORDER_DESC_TEMP = "OutpOrderDescTemp";

    //门诊医嘱明细计费项目对象类名称
    public static final String OUTP_BILL_ITEMS_TEMP = "OutpBillItemsTemp";
    //门诊处方医嘱对象类名称
    public static final String OUTP_DOC_PRESC_MASTER = "OutpDoctorPrescMaster";
    //门诊处方明细对象类名称
    public static final String OUTP_DOC_PRESC_ITEMS = "OutpDoctorPrescItems";
    //检验主表
    public static final String LAB_TEST_MASTER = "LabTestMaster";
    //门诊医嘱表对象类名
    public static final String OUTP_ORDER_DESC = "OutpOrderDesc";


    //门诊订单交易记录表名
    public static final String OUTP_PRE_RCPT_TEMP = "OutpPrepayRcptTemp";

    //门诊交易订单对应HIS业务明细列表

    public static final String ORDER_VS_BILL_LIST = "OrderVsBillList";

    //检查单号列名
    public static final String EXAM_NO = "exam_no";

    //检验单号列名
    public static final String TEST_NO = "test_no";


    //门诊打包项目分类西药
    public static final String EAST_DRUG = "A";

    //门诊打包项目分类中药
    public static final String WEST_DRUG = "B";

    //门诊打包项目分类检验
    public static final String TEST = "C";

    //门诊打包项目分类检查
    public static final String EXAM = "D";

    //门诊打包项目分类治疗
    public static final String TEATE = "I";

    //开单材料类别
    public static final String MATERIAL = "I";

    public static final String ADT = "ADT";
    //HL7处方需替换字符串
    public static final String MESSAGE_HL7_REPLACE_PRESC_BEF_TARGET = "<prescHl7Orders>";
    //HL7处方需替换字符串
    public static final String MESSAGE_HL7_REPLACE_PRESC_AFT_TARGET = "</prescHl7Orders>";

    //HL7处方事件编码
    public static final String MESSAGE_EVENT_PRESC = "OMP";
    //HL7处方事件名称
    public static final String MESSAGE_EVENT_NAME_PRESC = "O09";

    public static final String MESSAGE_EVENT_NAME_ALL_PRESC = "OMP_O09";

    //就诊时间
    public static final String VISIT_DATE = "VISIT_DATE";

    //HL7医嘱事件编码
    public static final String MESSAGE_EVENT_ORDER = "ORM";
    //HL7医嘱事件名称
    public static final String MESSAGE_EVENT_NAME_ORDER = "O01";

    public static final String MESSAGE_EVENT_NAME_ALL_ORDER = "ORM_O01";

    //HL7公共接收方编码
    public static final String MESSAGE_FROM_PUBLIC = "PubSoftWare";

    //HL7住院医嘱
    public static final String INP_ORM = "INPORDER";

    //HL7 新开 标记
    public static final String ORC_1_NEW = "NW";

    public static final String ORC_5_NEW = "SC";

    //HL7 新开 执行、计费
    public static final String ORC_1_PERFORM = "OH";

    public static final String ORC_5_PERFORM = "IP";


    //HL7 新开 停止
    public static final String ORC_1_STOP = "DR";

    public static final String ORC_5_STOP = "DC";


    //HL7 新开 作废
    public static final String ORC_1_DESTROY = "OC";

    public static final String ORC_5_DESTROY = "CA";

    //1-按条件中开始时间查询所有缴费和未缴费订单
    public static final String ALL_BILL_ITEMS = "1";

    //2-按HIS业务单号查询待缴费项目
    public static final String UNBILL_ITEMS = "2";

    //3-按HIS业务单号查询已缴费项目
    public static final String BILL_ITEMS = "3";

    //4-按订单号取消订单
    public static final String CANCEL_ORDER_NO = "4";

    //5-按订单号查询
    public static final String QUERY_ORDER_NO = "5";

    //6-按时间段查询计费订单信息
    public static final String TIME_ORDER_NO = "6";

    //7-按检查检验单号查询订单信息
    public static final String  BILL_C_D_NO= "7";

    //apply 的条件为患者ID及就诊次数有排序
    public static final String APPLY_PID_OUTPID_ORDER = "patient_id={0}  and outp_id={1} order by visit_date desc";

    //apply 的条件为患者ID及就诊次数无排序
    public static final String APPLY_PID_OUTPID = "patient_id={0}  and outp_id={1} ";

    //apply 的条件为患者ID及开始查询时间内的数据
    public static final String APPLY_QUE_OUTPVISIT_BY_STARTDATE = "patient_id={0}  and visit_date >= to_Date({1},'yyyy-mm-dd') order by visit_date desc";

    //apply 的条件为就诊时间就诊号的数据
    public static final String APPLY_QUE_VISITDATE_VISITNO = "visit_date = to_Date({0},'yyyy-MM-dd HH24:mi:ss') and visit_no={1} ";

    //apply 的条件为某时间段内的计费订单数据
    public static final String BILL_ORDER_LIST = "patient_id={0} and ESB_TRAN_STATUS = '1' and HIS_TRAN_STATUS = '1' " +
            "and ESB_TRANSACT_DATE > to_Date({1},'yyyy-mm-dd') " +
            "and  ESB_TRANSACT_DATE < to_Date({2},'yyyy-mm-dd') and TRANSACT_TYPE ='结算'  and order_no is not null";
    public static  final String REFUND_BILL= "rcpt_no = {0} or " +
            "rcpt_no = (select rcpt_no from outp_prepay_rcpt_temp where order_no = {0} and rownum = 1)";

    public static final String SELECT_CLINIC_MASTER="outp_id = (select max(outp_id)\n" +
            "                    from clinic_master\n" +
            "                   where visit_date > sysdate - (select parainit_value from app_configer_baseinfo where parameter_name ='REGIST_EFF' and rownum = 1 )\n" +
            "                     and patient_id = {0}\n" +
            "                     and doctor = {1}\n" +
            "                     and visit_dept = {2})\n" +
            "   and patient_id = {3} ";

    //成功标识
    public static final String  SUCCESS_CODE= "0000";

    public static final int  SUCCESS_CODE_INT= 0;

    //门诊根据检查检验查询订单信息
    public static final String  OUTP_SELECT_ORDER= "order_no = (select order_no\n" +
            "  from order_vs_billno\n" +
            " where bill_no in\n" +
            "       (select to_char(visit_date, 'yyyymmddhh24miss') || visit_no\n" +
            "          from outp_doctor_assistant\n" +
            "         where id ={1} and rownum=1 ) and rownum=1) and patient_id={0}";
    //住院根据检查检验查询订单信息
    public static final String  INP_SELECT_ORDER= "order_no = (  select order_no\n" +
            "  from order_vs_billno\n" +
            " where bill_no in\n" +
            "       (select patient_id ||'='|| visit_id||'='||order_no\n" +
            "          from doctor_orders\n" +
            "         where lis_id ={1} and  patient_id={0} and rownum=1) and rownum=1) and patient_id={2}";

    public static final String NLecg = "NLecg";

    //HL7患者信息登记事件
    public static final String MESSAGE_EVENT_PAT_VISIT = "ADT";
    //HL7患者信息登记事件
    public static final String MESSAGE_EVENT_NAME_PAT_VISIT = "A01";

    public static final String MESSAGE_EVENT_NAME_ALL_PAT_VISIT = "ADT_A01";
}
